<template>
  <div class="home">
    <h1>this is Home</h1>
    <h3>{{this.$route.params.age}}</h3>
    <button @click="getRouterParams">获取住组件传来的值</button>
    <div @click="back()">后退</div>
  </div>
</template>

<script>


export default {
  name: 'HomeView',
  components: {
  },
  methods: {
    getRouterParams () {
      console.log(this.$route.params);
    },
    back () {
      this.$router.go(-1)
    }
  }
}
</script>
<style scoped lang="less">
.home {
  height: 200px;
  background: red;
}
</style>
